home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / dterm.doc < prev    next >
Text File  |  1995-03-31  |  7KB  |  164 lines

  1. ******************* 
  2. DTERM V1.0 10.01.91 By Glenn G. Bruckno 
  3. ******************* 
  4.  
  5. THE POOP ON DTERM 
  6. ----------------- 
  7. DTERM is a dumb terminal emulator for the HP48.  I posted it here  
  8. because I couldn't find any other terminal emulator which completely  
  9. fit my needs.  It was written for a very specific work-related  
  10. application; as such, it may need tailoring for your particular use.  
  11. Fortunately, it is written without machine code and is easily modified. 
  12.  
  13. DTERM has some distinct advantages over the other terminal emulators  
  14. I've seen here on the BBS, including a true 10 line scrolling display. 
  15. Its big advantage is the ability to handle huge amounts of incoming 
  16. data, even at 9600 baud.  DTERM needs only the briefest of occasional  
  17. pauses from the host in order to buffer data.  Provided the HP returns 
  18. now and then from performing its own serial housekeeping, the amount  
  19. of data that can be buffered is limited only by available memory. 
  20.  
  21. THE POOP ON THE PROGRAMS 
  22. ------------------------ 
  23. Download the following binary attachment and you will see the  
  24. following appear in your current directory: 
  25.  
  26. TERM 
  27. A Directory consisting of the following programs: 
  28.  
  29.                                                      Stack action 
  30.                                                      ------------ 
  31.      DTERM     The main program,                      --  |  -- 
  32.                Saves your flags, 
  33.                creates temporary globals 
  34.                CRLF: A string "<cr> <lf>" 
  35.                INLN: An empty string: "" 
  36.                examines BUFLEN and assembles 
  37.                serial data INLN 
  38.                Restores your flags and 
  39.                purges temporary globals 
  40.                on exit 
  41.  
  42.      DOKEY     Routines for handling                  --  |  0/1 
  43.                a keypress.  Returns 1 
  44.                if the DEL key is pressed 
  45.                which ends the program, 
  46.                0 otherwise 
  47.  
  48.      SCROLL    Scrolls PICT up one line               --  |  -- 
  49.                (6 pixels) 
  50.  
  51.      PUTLN     Takes a string from Level         "string" |  -- 
  52.                1 and puts it on the bottom 
  53.                of PICT 
  54.  
  55.      STRIP     Removes characters from                --  |  -- 
  56.                incoming string INLN 
  57.                up to <cr> <lf>; calls  
  58.                SCROLL, passes string 
  59.                to PUTLN 
  60.  
  61. Now for its limitations:  Because DTERM turns incoming ASCII into  
  62. graphic objects for its display, each line should not exceed the  
  63. width of PICT.  In other words, the line width measured in terms of 
  64. characters depends on the pixel width of the characters displayed.   
  65. You can fit a whole bunch of i's across the display; not so many w's.   
  66. If a line is received which exceeds this, the excess is lopped off  
  67. into pixel oblivion.   
  68.  
  69. In addition, DTERM waits for a <cr> <lf> pair to be received before  
  70. it displays any preceding characters.  The <cr> <lf> is stripped off;  
  71. no other controls are stripped.  If your application is packet radio,  
  72. tell your fellow packeteers to send short lines! 
  73.  
  74. You can remove both these limitations by modifying STRIP to simply wait 
  75. for an arbitrary number of characters (i.e., examine the SIZE of INLN) 
  76. before executing SCROLL and PUTLN.  You will have to decide on a 
  77. reasonable columnar display width.   
  78.  
  79. If your host sends only <cr> at the end of a line, modify STRIP thusly: 
  80.  
  81. change PUTLN 2 + to 
  82.        PUTLN 1 + 
  83.  
  84. Also, remove the 10 CHR + part from DTERM (the linefeed char). 
  85.  
  86. CREDIT WHERE CREDIT IS DUE 
  87. -------------------------- 
  88. Thanks to Mr. Kevin Jessup for the keytable idea from his excellent  
  89. program DTE48.  I've hacked it for my purposes, so the following  
  90. changes are noted: 
  91.  
  92. 1. Default is upper case. 
  93. 2. No more toggle flag -- if you hit a gold  
  94.    or blue key once, it can't be undone. 
  95. 3. Alpha key eliminated -- I don't try to 
  96.    throttle the host. 
  97.  
  98. THE POOP ON USING DTERM 
  99. ----------------------- 
  100. Set up your serial I/O with the standard HP I/O SETUP menu.  Press  
  101. DTERM to run.  Press letter keys to send characters.  Press <left shift>  
  102. to change the next character to lower case.  Press <right shift> to  
  103. change the next character to a Control character: A becomes ^A etc. 
  104. Press ENTER to send a <cr>; <left shift> ENTER sends a <lf>. Unassigned 
  105. keys shoot blanks. Press DEL to quit.  
  106.  
  107. You can test DTERM in standalone mode by looping the serial connector  
  108. back to itself: jump the middle two pins on the serial connector. 
  109. Remember to set wire mode in the I/O SETUP menu. 
  110.  
  111. Because the SCROLL and PUTLN routines juggle graphic objects, they 
  112. take a lot of time to execute.  Therefore DTERM assigns high priority 
  113. to the incoming data.  SRECV is performed any time BUFLEN is nonzero. 
  114. Only when BUFLEN is zero, meaning no characters are staged for reception, 
  115. do SCROLL and PUTLN perform.  Even then, only one line is manipulated  
  116. before BUFLEN is again examined.  Rest assured that your characters 
  117. are being buffered even though no data may appear on the display for  
  118. a while.  When the host takes a breather, the data will scroll onto  
  119. the display slowly enough to read. 
  120.  
  121. I have reproduced here Mr. Kevin Jessup's translation table, modified: 
  122.  
  123. KEY        UNSHIFTED RESULT   LEFT SHIFTED RESULT   RIGHT SHIFTED RESULT 
  124. --------   ----------------   -------------------   -------------------- 
  125. A          A                  a                     ^A (ASCII 1) 
  126. B          B                  b                     ^B (ASCII 2) 
  127. C          C                  c                     ^C (ASCII 3)... 
  128.  
  129. Z          Z                  z                     ^Z (ASCII 26) 
  130.  
  131. 1          1                  ! 
  132. 2          2                  @ 
  133. 3          3                  # 
  134. 4          4                  $ 
  135. 5          5                  % 
  136. 6          6                  ^ 
  137. 7          7                  & 
  138. 8          8                  * 
  139. 9          9                  ( 
  140. 0          0                  ) 
  141. /          /                  ~ 
  142. *          *                  , 
  143. -          -                  _    (underscore) 
  144. +          +                  = 
  145. .          .                  < 
  146. SPC        space              > 
  147. <-         backspace          delete 
  148. ENTER      carriage return    linefeed 
  149. DEL        QUIT               QUIT 
  150.  
  151. OTHER POOP 
  152. ---------- 
  153. I have posted this program here so as to provide a tool for other  
  154. HP48 bitheads.  Examine the code, change it, improve it, have a  
  155. blast.  In exchange, I ask you to likewise upload your interesting 
  156. stuff for the overall good of mankind.  However, please give credit  
  157. where credit is due, and if you find a way to make money with my code,  
  158. my ugly lawyers and I will demand some fat royalties.   
  159.  
  160. Send comments, questions, etc to me: 
  161.  
  162. here under the name:            ggbruckno 
  163. or via packet radio:            KB2HBW @ W2EMU-4.NJ.USA.NA 
  164.